home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Personal Computer World 2009 February
/
PCWFEB09.iso
/
Software
/
Freeware
/
ReNamer 5.40
/
ReNamer.exe
/
{app}
/
Scripts
/
Move filename portion.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
2007-02-13
|
527b
|
18 lines
{ This script moves a portion of a filename }
const
MOVE_START = 5; // beginning of the movable portion
MOVE_LENGTH = 3; // length of the movable portion
MOVE_TO = 3; // new position for the portion
var
BaseName, Portion: WideString;
begin
BaseName := WideExtractBaseName(FileName);
Portion := WideCopy(BaseName, MOVE_START, MOVE_LENGTH);
WideDelete(BaseName, MOVE_START, MOVE_LENGTH);
WideInsert(Portion, BaseName, MOVE_TO);
FileName := BaseName + WideExtractFileExt(FileName);
end.